home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMULATOR / ARMUL / armul.diff
Text File  |  1997-02-26  |  16KB  |  461 lines

  1. diff -u --recursive --new-file armul-1.0/Makefile armul-1.0.1/Makefile
  2. --- armul-1.0/Makefile    Tue Dec 13 11:33:34 1994
  3. +++ armul-1.0.1/Makefile    Tue Feb 25 16:42:23 1997
  4. @@ -22,7 +22,7 @@
  5.  
  6.  prefix=/usr/local
  7.  CC = gcc
  8. -CFLAGS = -O2 -D$(ENDIAN) $(CFL) 
  9. +CFLAGS = -pedantic -Wall -O2 -D$(ENDIAN) $(CFL) 
  10.  INSTALL_DIR = $(prefix)/bin
  11.  INSTALL=cp
  12.  
  13. @@ -50,7 +50,7 @@
  14.      $(INSTALL) armul $(INSTALL_DIR)
  15.  
  16.  armul: $(OBJS) $(MODEL).o
  17. -    $(CC) $(CFLAGS) $(OBJS) $(MODEL).o -o $@ -lm -lXext -lX11
  18. +    $(CC) $(CFLAGS) $(OBJS) $(MODEL).o -o $@ -lm -lXext -lX11 -L/usr/X11R6/lib
  19.  
  20.  clean:
  21.      rm -f *.o armul core
  22. diff -u --recursive --new-file armul-1.0/armcopro.c armul-1.0.1/armcopro.c
  23. --- armul-1.0/armcopro.c    Fri Dec  9 13:37:19 1994
  24. +++ armul-1.0.1/armcopro.c    Tue Feb 25 17:19:01 1997
  25. @@ -16,6 +16,7 @@
  26.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  27.  
  28.  #include "armdefs.h"
  29. +#include "armrdi.h"
  30.  
  31.  extern unsigned ARMul_CoProInit(ARMul_State *state) ;
  32.  extern void ARMul_CoProExit(ARMul_State *state) ;
  33. diff -u --recursive --new-file armul-1.0/armemu.c armul-1.0.1/armemu.c
  34. --- armul-1.0/armemu.c    Fri Dec  9 13:38:37 1994
  35. +++ armul-1.0.1/armemu.c    Tue Feb 25 19:12:46 1997
  36. @@ -17,6 +17,7 @@
  37.  
  38.  #include "armdefs.h"
  39.  #include "armemu.h"
  40. +#include "armsupp.h"
  41.  
  42.  static ARMword GetDPRegRHS(ARMul_State *state, ARMword instr) ;
  43.  static ARMword GetDPSRegRHS(ARMul_State *state, ARMword instr) ;
  44. @@ -1805,7 +1806,7 @@
  45.  #ifdef MODE32
  46.               state->Reg[14] = pc + 4 ; /* put PC into Link */
  47.  #else
  48. -             state->Reg[14] = pc + 4 | ECC | ER15INT | EMODE ; /* put PC into Link */
  49. +             state->Reg[14] = (pc + 4) | ECC | ER15INT | EMODE ; /* put PC into Link */
  50.  #endif
  51.               state->Reg[15] = pc + 8 + POSBRANCH ;
  52.               FLUSHPIPE ;
  53. diff -u --recursive --new-file armul-1.0/armemu.h armul-1.0.1/armemu.h
  54. --- armul-1.0/armemu.h    Fri Dec  9 13:54:16 1994
  55. +++ armul-1.0.1/armemu.h    Tue Feb 25 19:18:50 1997
  56. @@ -139,7 +139,7 @@
  57.                          ASSIGNV((state->Reg[15] & VBIT) != 0) ; \
  58.                          } \
  59.                       else { \
  60. -                        state->Reg[15] = R15PC | (s) & (CCBITS | R15INTBITS | R15MODEBITS) ; \
  61. +                        state->Reg[15] = R15PC | ((s) & (CCBITS | R15INTBITS | R15MODEBITS)) ; \
  62.                          ARMul_R15Altered(state) ; \
  63.                          }
  64.  #define SETABORT(i,m) state->Cpsr = ECC | EINT | (i) | (m)
  65. diff -u --recursive --new-file armul-1.0/arminit.h armul-1.0.1/arminit.h
  66. --- armul-1.0/arminit.h    Thu Jan  1 01:00:00 1970
  67. +++ armul-1.0.1/arminit.h    Tue Feb 25 18:05:49 1997
  68. @@ -0,0 +1 @@
  69. +void ARMul_SelectProcessor(ARMul_State *, unsigned int);
  70. diff -u --recursive --new-file armul-1.0/armos.c armul-1.0.1/armos.c
  71. --- armul-1.0/armos.c    Fri Dec  9 13:40:53 1994
  72. +++ armul-1.0.1/armos.c    Tue Feb 25 17:36:44 1997
  73. @@ -25,6 +25,7 @@
  74.  #include <time.h>
  75.  #include <errno.h>
  76.  #include <string.h>
  77. +#include <unistd.h>
  78.  
  79.  #ifdef __STDC__
  80.  #define unlink(s) remove(s)
  81. @@ -53,6 +54,8 @@
  82.  
  83.  #include "armdefs.h"
  84.  #include "armos.h"
  85. +#include "armrdi.h"
  86. +#include "armsupp.h"
  87.  #ifndef NOOS
  88.  #ifndef VALIDATE
  89.  /* #ifndef ASIM */
  90. diff -u --recursive --new-file armul-1.0/armrdi.c armul-1.0.1/armrdi.c
  91. --- armul-1.0/armrdi.c    Fri Dec  9 13:42:17 1994
  92. +++ armul-1.0.1/armrdi.c    Tue Feb 25 19:03:11 1997
  93. @@ -20,6 +20,7 @@
  94.  #include "armdefs.h"
  95.  #include "armemu.h"
  96.  #include "armos.h"
  97. +#include "arminit.h"
  98.  #include "dbg_cp.h"
  99.  #include "dbg_conf.h"
  100.  #include "dbg_rdi.h"
  101. @@ -96,7 +97,6 @@
  102.  void ARMul_ConsolePrint(ARMul_State *state, const char *format, ...)
  103.  {
  104.    va_list ap;
  105. -  int ch;
  106.    char *str, buf[CONSOLE_PRINT_MAX_LEN];
  107.    int i, j;
  108.    ARMword junk;
  109. diff -u --recursive --new-file armul-1.0/armrdi.h armul-1.0.1/armrdi.h
  110. --- armul-1.0/armrdi.h    Thu Jan  1 01:00:00 1970
  111. +++ armul-1.0.1/armrdi.h    Tue Feb 25 17:18:37 1997
  112. @@ -0,0 +1 @@
  113. +void ARMul_ConsolePrint(ARMul_State *, const char *, ...);
  114. diff -u --recursive --new-file armul-1.0/armsupp.h armul-1.0.1/armsupp.h
  115. --- armul-1.0/armsupp.h    Thu Jan  1 01:00:00 1970
  116. +++ armul-1.0.1/armsupp.h    Tue Feb 25 17:31:51 1997
  117. @@ -0,0 +1,4 @@
  118. +void ARMul_FixCPSR(ARMul_State *, ARMword, ARMword) ;
  119. +void ARMul_FixSPSR(ARMul_State *, ARMword, ARMword) ;
  120. +void ARMul_UndefInstr(ARMul_State *, ARMword) ;
  121. +ARMword ARMul_SwitchMode(ARMul_State *, ARMword, ARMword) ;
  122. diff -u --recursive --new-file armul-1.0/armvirt.c armul-1.0.1/armvirt.c
  123. --- armul-1.0/armvirt.c    Fri Dec  9 14:50:41 1994
  124. +++ armul-1.0.1/armvirt.c    Tue Feb 25 18:34:38 1997
  125. @@ -23,8 +23,9 @@
  126.  freed as they might be needed again. A single area of memory may be
  127.  defined to generate aborts. */
  128.  
  129. -#include "armopts.h"
  130. +/*#include "armopts.h"*/
  131.  #include "armdefs.h"
  132. +#include "armrdi.h"
  133.  
  134.  #ifdef VALIDATE /* for running the validate suite */
  135.  #define TUBE 48 * 1024 * 1024 /* write a char on the screen */
  136. diff -u --recursive --new-file armul-1.0/bag.c armul-1.0.1/bag.c
  137. --- armul-1.0/bag.c    Fri Dec  9 13:46:12 1994
  138. +++ armul-1.0.1/bag.c    Tue Feb 25 18:30:01 1997
  139. @@ -24,6 +24,8 @@
  140.  /* is deleted.                                                      */
  141.  /********************************************************************/
  142.  
  143. +#include <stdlib.h>
  144. +
  145.  #include "bag.h"
  146.  
  147.  #define HASH_TABLE_SIZE 256
  148. diff -u --recursive --new-file armul-1.0/bag.h armul-1.0.1/bag.h
  149. --- armul-1.0/bag.h    Fri Dec  9 13:59:15 1994
  150. +++ armul-1.0.1/bag.h    Tue Feb 25 17:36:13 1997
  151. @@ -28,7 +28,7 @@
  152.  typedef enum {
  153.    NO_ERROR,
  154.    DELETED_OLD_PAIR,
  155. -  NO_SUCH_PAIR,
  156. +  NO_SUCH_PAIR
  157.  } Bag_error;
  158.  
  159.  void BAG_putpair(long first, long second);
  160. diff -u --recursive --new-file armul-1.0/communicate.c armul-1.0.1/communicate.c
  161. --- armul-1.0/communicate.c    Fri Dec  9 13:46:54 1994
  162. +++ armul-1.0.1/communicate.c    Tue Feb 25 18:37:16 1997
  163. @@ -25,6 +25,8 @@
  164.  #include <sys/types.h>
  165.  #include <sys/socket.h>
  166.  #include <netinet/in.h>
  167. +#include <unistd.h>
  168. +
  169.  
  170.  #include "armdefs.h"
  171.  
  172. @@ -79,7 +81,7 @@
  173.       this is probably preferable to locking up.  */
  174.        return -1;
  175.        fprintf(stderr, "Waiting for connection from debugger...");
  176. -      debugsock = accept(sockethandle, &isa, &i);
  177. +      debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
  178.        if (debugsock < 0) { /* Now we are in serious trouble... */
  179.      perror("accept");
  180.      return -1;
  181. @@ -129,7 +131,7 @@
  182.        fprintf(stderr, "Connection with debugger severed.\n");
  183.        return -1;
  184.        fprintf(stderr, "Waiting for connection from debugger...");
  185. -      debugsock = accept(sockethandle, &isa, &i);
  186. +      debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
  187.        if (debugsock < 0) { /* Now we are in serious trouble... */
  188.      perror("accept");
  189.      return -1;
  190. @@ -181,7 +183,7 @@
  191.    for (i = 0; MYwrite_char(sock, s[i]), s[i]; i++);
  192.  }
  193.  
  194. -int MYread_FPword(int sock, char *putinhere) {
  195. +int MYread_FPword(int sock, unsigned char *putinhere) {
  196.    int i;
  197.    for (i = 0; i < 16; i++)
  198.      if (MYread_char(sock, &putinhere[i]) < 0) return -1;
  199. @@ -197,10 +199,10 @@
  200.  /* Takes n bytes from source and those n bytes */
  201.  /* down to dest */
  202.  int passon(int source, int dest, int n) {
  203. -  char *p;
  204. +  unsigned char *p;
  205.    int i;
  206.    
  207. -  p = (char *) malloc(n);
  208. +  p = (unsigned char *) malloc(n);
  209.    if (!p) {
  210.      perror("Out of memory\n");
  211.      exit(1);
  212. diff -u --recursive --new-file armul-1.0/communicate.h armul-1.0.1/communicate.h
  213. --- armul-1.0/communicate.h    Fri Dec  9 13:59:55 1994
  214. +++ armul-1.0.1/communicate.h    Tue Feb 25 18:53:08 1997
  215. @@ -19,9 +19,9 @@
  216.  void MYwrite_char(int sock, unsigned char c);
  217.  int MYread_word(int sock, ARMword *here);
  218.  void MYwrite_word(int sock, ARMword i);
  219. -void MYwrite_string(int sock, char *s);
  220. -int MYread_FPword(int sock, char *putinhere);
  221. -void MYwrite_FPword(int sock, char *fromhere);
  222. +void MYwrite_string(int sock, unsigned char *s);
  223. +int MYread_FPword(int sock, unsigned char *putinhere);
  224. +void MYwrite_FPword(int sock, unsigned char *fromhere);
  225.  int passon(int source, int dest, int n);
  226.  
  227.  int wait_for_osreply(ARMword *reply);  /* from kid.c */
  228. diff -u --recursive --new-file armul-1.0/kid.c armul-1.0.1/kid.c
  229. --- armul-1.0/kid.c    Fri Dec  9 13:50:19 1994
  230. +++ armul-1.0.1/kid.c    Tue Feb 25 19:00:17 1997
  231. @@ -24,6 +24,8 @@
  232.  
  233.  #include <sys/types.h>
  234.  #include <signal.h>
  235. +#include <unistd.h>
  236. +#include <sys/time.h>
  237.  
  238.  #include "armdefs.h"
  239.  #include "dbg_conf.h"
  240. @@ -31,6 +33,7 @@
  241.  #include "dbg_rdi.h"
  242.  #include "gdbhost.h"
  243.  #include "communicate.h"
  244. +#include "bag.h"
  245.  
  246.  /* The pipes between the two processes */
  247.  extern int mumkid[2];
  248. @@ -61,7 +64,7 @@
  249.    fprintf(stderr, "Terminate ARMulator excecution\n");
  250.  #endif
  251.    if (sig != SIGUSR1) {
  252. -    fprintf("Unsupported signal.\n");
  253. +    fprintf(stderr, "Unsupported signal.\n");
  254.      return;
  255.    }
  256.    armul_rdi.info(RDISignal_Stop, (unsigned long *) 0, (unsigned long *) 0);
  257. @@ -72,7 +75,7 @@
  258.  /* acts as an RDP to RDI interpreter on the front of the ARMulator. */
  259.  /********************************************************************/
  260.  void kid() {
  261. -  char *p, *q;
  262. +  unsigned char *p, *q;
  263.    int i, j, k;
  264.    long outofthebag;
  265.    unsigned char c, d, message;
  266. @@ -82,7 +85,7 @@
  267.    Dbg_ConfigBlock config;
  268.    Dbg_HostosInterface hostif;
  269.    struct Dbg_MCState *MCState;
  270. -  char command_line[256];
  271. +  unsigned char command_line[256];
  272.    struct fd_set readfds;
  273.    
  274.    /* Setup a signal handler for SIGUSR1 */
  275. @@ -162,7 +165,7 @@
  276.        /* Read Memory Address */      
  277.        MYread_word(mumkid[0], &x); /* address */
  278.        MYread_word(mumkid[0], &y); /* nbytes */
  279. -      p = (char *) malloc(y);
  280. +      p = (unsigned char *) malloc(y);
  281.        i = armul_rdi.read(x, p, (unsigned *) &y);
  282.        MYwrite_char(kidmum[1], RDP_Return);
  283.        for (k = 0; k < y; k++)
  284. @@ -177,7 +180,7 @@
  285.        /* Write Memory Address */
  286.        MYread_word(mumkid[0], &x); /* address */
  287.        MYread_word(mumkid[0], &y); /* nbytes */
  288. -      p = (char *) malloc(y);
  289. +      p = (unsigned char *) malloc(y);
  290.        for (k = 0; k < y; k++)
  291.      MYread_char(mumkid[0], &p[k]);
  292.        i = armul_rdi.write(p, x, (unsigned *) &y);
  293. @@ -192,7 +195,7 @@
  294.        /* Read CPU State */
  295.        MYread_char(mumkid[0], &c); /* mode */
  296.        MYread_word(mumkid[0], &x); /* mask */
  297. -      p = (char *) malloc(4 * RDINumCPURegs);
  298. +      p = (unsigned char *) malloc(4 * RDINumCPURegs);
  299.        i = armul_rdi.CPUread(c, x, (ARMword *) p);
  300.        MYwrite_char(kidmum[1], RDP_Return);
  301.        for (k = 1, j = 0; k != 0x80000000; k *= 2)
  302. @@ -207,7 +210,7 @@
  303.        MYread_char(mumkid[0], &c); /* mode */
  304.        MYread_word(mumkid[0], &x); /* mask */
  305.  
  306. -      p = (char *) malloc(4 * RDINumCPURegs);
  307. +      p = (unsigned char *) malloc(4 * RDINumCPURegs);
  308.        for (k = 1, j = 0; k != 0x80000000; k *= 2)
  309.      if (k & x) MYread_word(mumkid[0], &(((ARMword *) p)[j++]));
  310.        i = armul_rdi.CPUwrite(c, x, (ARMword *) p);
  311. @@ -220,7 +223,7 @@
  312.        /* Read Co-Processor State */
  313.        MYread_char(mumkid[0], &c); /* CPnum */
  314.        MYread_word(mumkid[0], &x); /* mask */
  315. -      p = q = (char *) malloc(16 * RDINumCPRegs);
  316. +      p = q = (unsigned char *) malloc(16 * RDINumCPRegs);
  317.        i = armul_rdi.CPread(c, x, (ARMword *) p);
  318.        MYwrite_char(kidmum[1], RDP_Return);
  319.        for (k = 1, j = 0; k != 0x80000000; k *= 2, j++)
  320. @@ -243,7 +246,7 @@
  321.        /* Write Co-Processor State */
  322.        MYread_char(mumkid[0], &c); /* CPnum */
  323.        MYread_word(mumkid[0], &x); /* mask */
  324. -      p = q = (char *) malloc(16 * RDINumCPURegs);
  325. +      p = q = (unsigned char *) malloc(16 * RDINumCPURegs);
  326.        for (k = 1, j = 0; k != 0x80000000; k *= 2, j++)
  327.      if (k & x) {
  328.        if ((c == 1 || c == 2) && k <= 128) {
  329. @@ -387,7 +390,7 @@
  330.        break;
  331.  
  332.      default:
  333. -      fprintf (stderr, "Unsupported info code %d\n", x);
  334. +      fprintf (stderr, "Unsupported info code %lu\n", x);
  335.        break;
  336.      }
  337.        break;
  338. @@ -401,8 +404,8 @@
  339.        /* Reset */
  340.        for (i = 0; i < 50; i++)
  341.      MYwrite_char(kidmum[1], RDP_Reset);
  342. -      p = (char *) malloc(MAXHOSTNAMELENGTH + 5 + 20);
  343. -      sprintf(p, "Running on %s:%d\n", localhost, socketnumber);
  344. +      p = (unsigned char *) malloc(MAXHOSTNAMELENGTH + 5 + 20);
  345. +      sprintf((char *)p, "Running on %s:%d\n", localhost, socketnumber);
  346.        MYwrite_string(kidmum[1], p);
  347.        free(p);
  348.        
  349. @@ -421,16 +424,11 @@
  350.  /* in 'putinr0' with the data if appropriate. */
  351.  int wait_for_osreply(ARMword *reply)
  352.  {
  353. -  char *p, *q;
  354. -  int i, j, k;
  355. -  unsigned char c, d, message;
  356. -  ARMword x, y, z;
  357. +  unsigned char *p;
  358. +  int i, k;
  359. +  unsigned char c, message;
  360. +  ARMword x, y;
  361.    struct sigaction action;
  362. -  PointHandle point;
  363. -  Dbg_ConfigBlock config;
  364. -  Dbg_HostosInterface hostif;
  365. -  struct Dbg_MCState *MCState;
  366. -  char command_line[256];
  367.    struct fd_set readfds;
  368.    
  369.  #ifdef DEBUG
  370. @@ -468,7 +466,7 @@
  371.        /* Read Memory Address */
  372.        MYread_word(mumkid[0], &x); /* address */
  373.        MYread_word(mumkid[0], &y); /* nbytes */
  374. -      p = (char *) malloc(y);
  375. +      p = (unsigned char *) malloc(y);
  376.        i = armul_rdi.read(x, p, (unsigned *) &y);
  377.        MYwrite_char(kidmum[1], RDP_Return);
  378.        for (k = 0; k < y; k++)
  379. @@ -483,7 +481,7 @@
  380.        /* Write Memory Address */
  381.        MYread_word(mumkid[0], &x); /* address */
  382.        MYread_word(mumkid[0], &y); /* nbytes */
  383. -      p = (char *) malloc(y);
  384. +      p = (unsigned char *) malloc(y);
  385.        for (k = 0; k < y; k++)
  386.      MYread_char(mumkid[0], &p[k]);
  387.        i = armul_rdi.write(p, x, (unsigned *) &y);
  388. @@ -497,7 +495,7 @@
  389.      case RDP_OSOpReply :
  390.        /* OS Operation Reply */
  391.        MYread_char(mumkid[0], &c);
  392. -      if (c == 1) MYread_char(mumkid[0], (char *) reply);
  393. +      if (c == 1) MYread_char(mumkid[0], (unsigned char *) reply);
  394.        if (c == 2) MYread_word(mumkid[0], reply);
  395.        return c;
  396.        break;
  397. diff -u --recursive --new-file armul-1.0/main.c armul-1.0.1/main.c
  398. --- armul-1.0/main.c    Fri Dec  9 13:33:10 1994
  399. +++ armul-1.0.1/main.c    Tue Feb 25 18:26:25 1997
  400. @@ -35,21 +35,6 @@
  401.  
  402.  #define MAXHOSTNAMELENGTH 64
  403.  
  404. -/* Read and write routines down sockets and pipes */
  405. -
  406. -void MYread_chars(int sock, void *p, int n);
  407. -unsigned char MYread_char(int sock);
  408. -ARMword MYread_word(int sock);
  409. -void MYread_FPword(int sock, char *putinhere);
  410. -
  411. -void MYwrite_word(int sock, ARMword i);
  412. -void MYwrite_string(int sock, char *s);
  413. -void MYwrite_FPword(int sock, char *fromhere);
  414. -void MYwrite_char(int sock, unsigned char c);
  415. -
  416. -void passon(int source, int dest, int n);
  417. -
  418. -
  419.  /* Mother and child processes */
  420.  void parent (void);
  421.  void kid(void);
  422. @@ -123,7 +108,7 @@
  423.    for(i = 0; i < sizeof(devil.sin_zero); i++) devil.sin_zero[i] = '\000';
  424.    memcpy(&devil.sin_addr, hp->h_addr_list[0], hp->h_length);
  425.  
  426. -  if (bind(sockethandle, &devil, sizeof(devil)) < 0) {
  427. +  if (bind(sockethandle, (struct sockaddr *)&devil, sizeof(devil)) < 0) {
  428.      perror("bind");
  429.      return 1;
  430.    }
  431. @@ -137,7 +122,7 @@
  432.  
  433.    fprintf(stderr, "Waiting for connection from debugger...");
  434.  
  435. -  debugsock = accept(sockethandle, &isa, &i);
  436. +  debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
  437.    if (debugsock < 0) {
  438.      perror("accept");
  439.      return 1;
  440. diff -u --recursive --new-file armul-1.0/parent.c armul-1.0.1/parent.c
  441. --- armul-1.0/parent.c    Fri Dec  9 13:51:16 1994
  442. +++ armul-1.0.1/parent.c    Tue Feb 25 17:54:46 1997
  443. @@ -24,6 +24,8 @@
  444.  #include <stdio.h>
  445.  #include <sys/types.h>
  446.  #include <signal.h>
  447. +#include <unistd.h>
  448. +#include <sys/time.h>
  449.  
  450.  #include "armdefs.h"
  451.  #include "dbg_rdi.h"
  452. @@ -415,7 +417,7 @@
  453.            break;
  454.  
  455.          default:
  456. -          fprintf (stderr, "Unrecognized RDIInfo request %d\n",
  457. +          fprintf (stderr, "Unrecognized RDIInfo request %lu\n",
  458.                 messagetype);
  459.            goto panic_error;
  460.          }
  461.